package com.wz.dhs.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wz.dhs.dto.user.RoleQueryDTO;
import com.wz.dhs.po.user.SysMenu;
import com.wz.dhs.po.user.SysRole;
import com.wz.dhs.po.user.SysUserEntity;
import com.wz.dhs.vo.base.SysDictData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserMapper extends BaseMapper<SysUserEntity> {



    List<String> selectMenuPermsByRoleId(Long roleId);

    List<String> selectMenuPermsByUserId(Long userId);

    List<SysRole> selectRolePermissionByUserId(@Param("userId") Long userId);

    List<Long> listRolesById(Long userId);

    List<SysMenu> selectMenuTreeByUserId(Long userId);

    List<SysMenu> selectMenuListByUserId(@Param("data") SysMenu menu,@Param("userId") Long userId);

    List<SysDictData> selectDictDataByType(@Param("dictType") String dictType);

    Page<SysRole> selectRoleList(Page<Object> objectPage,@Param("data") RoleQueryDTO role);

    List<String> queryUserRole(@Param("userId") Long userId);

    /**
     * 根据条件分页查询已配用户角色列表
     *
     * @param user 用户信息
     * @return 用户信息集合信息
     */
    Page<SysUserEntity> selectAllocatedList(Page page,@Param("data") SysUserEntity user);

    /**
     * 根据条件分页查询未分配用户角色列表
     *
     * @param user 用户信息
     * @return 用户信息集合信息
     */
    Page<SysUserEntity> selectUnallocatedList(Page page,@Param("data") SysUserEntity user);
}
